package com.headfirst.decorator.version1;

/**
 * 深焙咖啡,是一种具体的饮料,继承了抽象的饮料类Beverage
 * @author sunhongguang
 * @create 2022-01-22-20:53
 */
public class DarkRoast extends Beverage {
    public DarkRoast() {
        super.setDescription(super.getSize()+" DarkRoast");
    }

    public DarkRoast(String size) {
        super.setSize(size);
        super.setDescription(size+" DarkRoast");
    }
    @Override
    public double cost() {
        double price = 0;
        switch (super.getSize()){
            case "小杯":
                price = 0.99;
                break;
            case "中杯":
                price = 1.19;
                break;
            case "大杯":
                price = 1.39;
                break;
            case "超大杯":
                price = 1.59;
                break;
        }
        return price;
    }
}
